import { get, post, exportFile } from '@/utils/request'

import type { RequestOptions } from '@/utils/request/types'
import type { LoginData, LoginResult } from './types'

/**
 * 用户登录API
 *
 * @param params 登录数据
 * @param options 请求选项
 * @returns 登录结果
 */
export function login<T = any, D = unknown>(params: D, options = {}) {
	// return post<T, D>('/apifox/login', params, options)
	return post<T, D>('/login', params, options)
}
// 用户退出登录
export function logout<T = any, D = unknown>(params: Partial<D> = {}, options = {}) {
	return post<T, Partial<D>>('/apifox/logout', params, options)
}
// 获取验证码
export function getCodeImg<T = any, D = unknown>(params: Partial<D> = {}, options = {}) {
	return get<T, Partial<D>>('/captchaImage', params, options)
}

//
export function getMenuListApi<T = any, D = any>(params = {} as D, options = {}) {
	// return get<U, T>('/mock-api/menu/list', params)
	return get<T, D>('/apifox/menu/list', params, options)
}

// 导出文件
export function exportFiles<T>(params = {}) {
	return exportFile<T>('/business-app/api/v2/workorder/workorderMove/export', params)
}
